<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<!--edge浏览器H5兼容设置-->
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<!--360浏览器H5兼容设置-->
		<meta name="renderer" content="webkit" />
		<title>电脑商城</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!--导入核心文件-->
		<script src="../bootstrap3/js/holder.js"></script>
		<link href="../bootstrap3/css/bootstrap.css" rel="stylesheet" type="text/css">
		<script src="../bootstrap3/jquery-1.9.1.min.js"></script>
		<script src="../bootstrap3/js/bootstrap.js"></script>
		<!-- 字体图标 -->
		<link rel="stylesheet" href="../bootstrap3/font-awesome-4.7.0/css/font-awesome.css" />
		<link rel="stylesheet" type="text/css" href="../css/layout.css" />
		<link rel="stylesheet" type="text/css" href="../css/top.css" />
		<link rel="stylesheet" type="text/css" href="../css/footer.css" />
		<link rel="stylesheet" type="text/css" href="../css/orderInfo.css" />
		<link rel="stylesheet" type="text/css" href="../css/order.css" />
	</head>

	<body>
		<!--头部-->
		<header class="header">
			<!--电脑商城logo-->
			<div class="row">
				<div class="col-md-3">
					<a href="index.html">
						<img src="../images/index/stumalllogo.png" />
					</a>
				</div>
				<!--快捷选项-->
				<div class="col-md-9 top-item">
					<ul class="list-inline pull-right">
						<li><a href="favorites.html"><span class="fa fa-heart"></span>&nbsp;收藏</a></li>
						<li class="li-split">|</li>
						<li><a href="orders.html"><span class="fa fa-file-text"></span>&nbsp;订单</a></li>
						<li class="li-split">|</li>
						<li><a href="cart.html"><span class="fa fa-cart-plus"></span>&nbsp;购物车</a></li>
						<li class="li-split">|</li>
						<li>
							<!--下列列表按钮 ：管理-->
							<div class="btn-group">
								<button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown">
									<span id="top-dropdown-btn"><span class="fa fa-gears"></span>&nbsp;管理 <span class="caret"></span></span>
								</button>
								<ul class="dropdown-menu top-dropdown-ul" role="menu">
									<li><a href="password.html">修改密码</a></li>
									<li><a href="userdata.html">个人资料</a></li>
									<li><a href="upload.html">上传头像</a></li>
									<li><a href="address.html">收货管理	</a></li>
								</ul>
							</div>
						</li>
						<li class="li-split">|</li>
						<li><a href="login.html"><span class="fa fa-user"></span>&nbsp;登录</a></li>
					</ul>
				</div>
			</div>
		</header>
		<!--导航 -->
		<!--分割导航和顶部-->
		<div class="row top-nav">
			<div class="col-md-6">
				<ul class="nav nav-pills">
					<li>
						<a href="#"></a>
					</li>
					<li class="active"><a href="index.html"><span class="fa fa-home"></span></a></li>
					<li><a href="#">秒杀</a></li>
					<li><a href="#">优惠券</a></li>
					<li><a href="#">电脑VIP</a></li>
					<li><a href="#">外卖</a></li>
					<li><a href="#">超市</a></li>
				</ul>
			</div>
			<div class="col-md-6">
				<form action="search.html" class="form-inline pull-right" role="form">
					<div class="form-group">
						<input type="text" class="form-control" id="search" name="search" placeholder="请输入商品名称进行搜索">
					</div>
					<button type="submit" class="btn btn-default btn-sm"><span class="fa fa-search"></span></button>
				</form>
			</div>
		</div>
		<!--头部结束-->
		<!--导航结束-->
		<!--页面主体开始-->
		<div class="container">
			<div class="col-md-offset-1 col-md-10">
				<h1>订单详情：</h1>
				<h2 class="page-header">状态信息：</h2>
				<div id="order" class="state-bar">
					订单号：1101000301 ，当前状态：等待收货
				</div>
				<ol id="msg" class="order-flow">
					<li class="order-success">1.提交订单 <small>2022-2-22 20:32:17</small> <span class="fa fa-check-circle"></span></li>
					<li class="order-success">2.付款成功 <small>2022-2-22 20:35:03</small> <span class="fa fa-check-circle"></span></li>
					<li class="order-success">3.商城发货 <small>2022-2-23 08:13:34</small> <span class="fa fa-check-circle"></span></li>
					<li>4.用户收货</li>
					<li>5.购物评价</li>
				</ol>
				<h2 class="page-header">地址详情：</h2>
				<div id="address">
					<p>收货人姓名：八戒，邮政编码：100190，联系电话： 1380***1234</p>
					<p>收货地址：北京市房山区高老庄3排6号</p>
				</div>
				<div id="logistics">
					<h2 class="page-header">物流信息：</h2>
					<p>发货时间：2022-2-22 08:13:34</p>
					<p>物流公司：顺丰快递</p>
					<p>快递单号：301111303203048</p>
					<p>物流信息：</p>
					<p>2022-2-23 08:13:34 您的快递在【北京国贸分拣中心】分拣完毕</p>
					<p>2022-2-24 08:39:50 您的快递在【北京国贸分拣中心】准备装车</p>
					<p>2022-2-25 12:20:07 您的快递到达【北京中关村分拣中心】</p>
				</div>
				<h2 class="page-header">商品详情：</h2>
				<div id="orderInfo" class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title">
               			订单号：1101000301，下单时间：2018-12-2 20:32:17 ， 收货人：八戒
            		</h3>
					</div>
					<div class="panel-body">
						<table class="orders-table">
							<thead>
								<tr>
									<th width="15%"></th>
									<th width="35%">商品</th>
									<th width="15%">单价</th>
									<th width="15%">数量</th>
									<th width="20%">小计</th>
								</tr>
							</thead>
							<tbody class="orders-body">
								<tr>
									<td><img src="../images/portal/12DELLXPS13-silvery/collect.png" class="img-responsive" /></td>
									<td>联想(Lenovo)小新Air13 Pro 13.3英寸14.8mm超轻薄笔记本电脑</td>
									<td>¥<span>5298</span></td>
									<td>1件</td>
									<td>¥<span>5298</span></td>
								</tr>
							</tbody>
						</table>
						<div>
							<span class="pull-right">订单总金额：¥5298</span>
						</div>
					</div>
				</div>
				<a href="orders.html">返回</a>
			</div>
		</div>
		<!--页脚开始-->
		<div class="clearfix"></div>
		<footer class="footer">
			<!-- 品质保障，私人定制等-->
			<div class="text-center rights container">
				<div class="col-md-offset-2 col-md-2">
					<span class="fa fa-thumbs-o-up"></span>
					<p>品质保障</p>
				</div>
				<div class="col-md-2">
					<span class="fa fa-address-card-o"></span>
					<p>私人订制</p>
				</div>
				<div class="col-md-2">
					<span class="fa fa-graduation-cap"></span>
					<p>学生特供</p>
				</div>
				<div class="col-md-2">
					<span class="fa fa-bitcoin"></span>
					<p>专属特权</p>
				</div>
			</div>
			<!--联系我们、下载客户端等-->
			<div class="container beforeBottom">
				<div class="col-md-offset-1 col-md-3">
					<div><img src="../images/index/stumalllogo.png" alt="" class="footLogo" /></div>
					<div><img src="../images/index/footerFont.png" alt="" /></div>
				</div>
				<div class="col-md-4 callus text-center">
					<div class="col-md-4">
						<ul>
							<li>
								<a href="#">
									<p>买家帮助</p>
								</a>
							</li>
							<li><a href="#">新手指南</a></li>
							<li><a href="#">服务保障</a></li>
							<li><a href="#">常见问题</a></li>
						</ul>
					</div>
					<div class="col-md-4">
						<ul>
							<li>
								<a href="#">
									<p>商家帮助</p>
								</a>
							</li>
							<li><a href="#">商家入驻</a></li>
							<li><a href="#">商家后台</a></li>
						</ul>
					</div>
					<div class="col-md-4">
						<ul>
							<li>
								<a href="#">
									<p>关于我们</p>
								</a>
							</li>
							<li><a href="#">关于圆心</a></li>
							<li><a href="#">联系我们</a></li>
							<li>
								<span class="fa fa-wechat"></span>
								<span class="fa fa-weibo"></span>
							</li>
						</ul>
					</div>
				</div>
				<div class="col-md-4">
					<div class="col-md-5">
						<p>电脑商城客户端</p>
						<img src="../images/index/ios.png" class="lf">
						<img src="../images/index/android.png" alt="" class="lf" />
					</div>
					<div class="col-md-6">
						<img src="../images/index/erweima.png">
					</div>
				</div>
			</div>
			<!-- 页面底部-备案号 #footer -->
			<div class="col-md-12 text-center bottom">
				Copyright © 2022 dnsc.cn All Rights Reserved 京ICP备08963888号-45 <a target="_blank" href="http://www.dnsc.cn/">圆心科技集团有限公司</a> 版权所有
			</div>
		</footer>
		<!--页脚结束-->

		<script type="text/javascript" src="../js/jquery-getUrlParam.js"></script>
		<script type="text/javascript">
			<!--页面点开自动加载  单个订单信息显示功能-->
			$(document).ready(function () {
				//获取上个页面传来的orderNum ,id
				let orderNum=$.getUrlParam("orderNum");
				let id=$.getUrlParam("id");
				//ajax异步获取订单信息
				$.ajax({
					url:"/order/getOneOrder",
					type:"get",
					data:{
						orderNum:orderNum,
						id:id,
					},
					dataType:"json",
					success:function (res) {
						$("#order").empty();
						$("#address").empty();
						$("#orderInfo").empty();
						if(res.state==200){
							//将查询到的数据绑定到页面 显示 //status  //0未付款 1已经付款 2未发货 3已发货 4 已收货
							if(res.data.status==0){
								$("#order").append("订单号："+res.data.orderNum+"，当前状态：未付款");
								$("#logistics").empty();
								$("#msg").empty();
							}else if(res.data.status==3){
								$("#order").append("订单号："+res.data.orderNum+"，当前状态：已发货");
							}else if(res.data.status==4){
								$("#order").append("订单号："+res.data.orderNum+"，当前状态：已经收货");
								let html="<p style='color: green'>2022-2-27 12:20:07 您的快递到达,【已经确认收货】</p>";
								$("#logistics").append(html);
							}

							let html="<p>收货人姓名：#{name}，联系电话：#{phone}</p>\n" +
									"<p>收货地址：#{tag} #{address}</p>";
							html=html.replace("#{name}",res.data.recvName);
							html=html.replace("#{phone}",res.data.phone);
							html=html.replace("#{tag}",res.data.recvTag);
							html=html.replace("#{address}",res.data.recvAddress);
							$("#address").append(html);

							let html2="<div class=\"panel-heading\">\n" +
									"<h3 class=\"panel-title\">\n" +
									"订单号：#{orderNum}，下单时间：#{createdTime} ， 收货人：#{name}\n" +
									"</h3>\n" +
									"</div>\n" +
									"<div class=\"panel-body\">\n" +
									"<table class=\"orders-table\">\n" +
									"<thead>\n" +
									"<tr>\n" +
									"<th width=\"15%\"></th>\n" +
									"<th width=\"35%\">商品</th>\n" +
									"<th width=\"15%\">单价</th>\n" +
									"<th width=\"15%\">数量</th>\n" +
									"<th width=\"20%\">小计</th>\n" +
									"</tr>\n" +
									"</thead>\n" +
									"<tbody class=\"orders-body\">\n" +
									"<tr>\n" +
									"<td><img src=\"..#{image}collect.png\" class=\"img-responsive\" /></td>\n" +
									"<td>#{title}</td>\n" +
									"<td>¥<span>#{price}</span></td>\n" +
									"<td>#{num}件</td>\n" +
									"<td>¥<span>#{total}</span></td>\n" +
									"</tr>\n" +
									"</tbody>\n" +
									"</table>\n" +
									"<div>\n" +
									"<span class=\"pull-right\">订单总金额：¥#{total}</span>\n" +
									"</div>\n" +
									"</div>";
							html2=html2.replace("#{orderNum}",res.data.orderNum);
							html2=html2.replace("#{createdTime}",res.data.createdTime);
							html2=html2.replace("#{name}",res.data.recvName);
							html2=html2.replace("#{image}",res.data.image);
							html2=html2.replace("#{title}",res.data.title);
							html2=html2.replace("#{price}",res.data.price);
							html2=html2.replace("#{num}",res.data.num);
							html2=html2.replace(/#{total}/g,parseFloat(res.data.price)*res.data.num);
							$("#orderInfo").append(html2);
						}else{
							alert(res.msg);
						}
					},
					error:function (xhr) {
						alert("查询出现异常"+xhr.status);
					}
				});
			});
		</script>
	</body>

</html>